package com.b2c.mapper;

import com.mr.service.pojo.BrandEntity;
import com.mr.service.pojo.CategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;

import java.util.Calendar;
import java.util.List;
import java.util.Locale;

@Mapper
public interface CategoryMapper extends tk.mybatis.mapper.common.Mapper<CategoryEntity>, SelectByIdListMapper<CategoryEntity, Long> {

    @Select("SELECT * FROM tb_category WHERE id IN (SELECT category_id FROM tb_category_brand WHERE brand_id = #{bid})")
    public List<CategoryEntity> queryCategoryListByBid(@Param("bid") Long bid);

    @Select("SELECT name FROM tb_category where parent_id = #{id} AND is_parent = #{boo}")
    List<String> getName(@Param("id") Long id,@Param("boo") Boolean boo);

}
